from django.template.library import Library

from ..models import Product

register = Library()
@register.filter
def is_active(product):
    if product.is_active:
        return '已上架'
    return '未上架'